﻿#ifndef USERDAO_H
#define USERDAO_H

#include <QObject>
#include "user.h"

class UserDao
{
public:
    explicit UserDao(QSqlDatabase sqlDatabase);
//    bool getUserByUserNameAndPassword(User &user,const QString &username,const QString &password);
//    bool getUserByUserName(User &user,const QString &username);
    bool getTotal(uint64_t &total);
    bool getList(QList<User> &list);
    bool getTotalByParam(uint64_t &total);
    bool getPageListByParam(QList<User> &list,const  uint64_t &page,const  uint64_t &pageSize);
    bool getOne(User &object);
    bool saveOne(User &object);
    bool deleteOne(User &object);
private:
    QSqlDatabase db;
};

#endif // USERDAO_H
